<template>
  <div class="boxhz" ref="boxhz">
    <!-- <van-icon name="back-top" color="#ee0a24" size="30" @click="clickIcon"/> -->
    <FanHui></FanHui>
    <div class="box" v-for="item in topicList" :key="item.id">
      <img v-lazy="item.scene_pic_url" alt="">
      <h3>{{item.title}}</h3>
      <h4>{{item.subtitle}}</h4>
      <p>{{item.price_info | RMBformat}} 起</p>
    </div>
  </div>
</template>

<script>
import {getTopicList} from '@/request/api.js'
import FanHui from '@/components/FanHui.vue'
export default {
  name: 'Topic',
  components:{
    FanHui
  },
  data(){
    return{
      page:1,
      pageSize:20,
      topicList:[]
    }
  },
  async created(){
    const res =  await getTopicList({
      page:this.page,
      size:this.pageSize
    })
    if(res.errno == 0){
      this.topicList = res.data.data
    }
  },
  methods:{
    clickIcon(){
      window.scroll(0,0)
    }
  },
}

</script>

<style lang="less" scoped>
.boxhz{
  padding-bottom: .3rem;
}
.van-icon{
  position: fixed;
  right: 5%;
  bottom: 10%;
  
}
.box{
  background-color: #fff;
  margin-bottom: .3rem;
  text-align: center;
  line-height: 2;
  padding-bottom: .2rem;
  img{
    width: 100%;
  }
  h3{
    font-size: .20rem;
  }
  h4,p{
    font-size: .16rem;
  }
  p{
    color: darkred;
  }
}
</style>